<template>
  <div class="dashboard-editor-container">
    <!-- <github-corner class="github-corner" /> -->
    <panel-group @handleSetLineChartData="handleSetLineChartData" />
    <el-row>
      <el-col :span="24">
        <operateProcess />
      </el-col>
    </el-row>
    <el-row>
      <plat />
    </el-row>

  </div>
</template>

<script>
  import GithubCorner from '@/components/GithubCorner'
  import PanelGroup from './components/PanelGroup'
  import LineChart from './components/LineChart'
  import RaddarChart from './components/RaddarChart'
  import PieChart from './components/PieChart'

  import plat from './components/plat.vue'
  import operateProcess from './components/operateProcess.vue'
  import BarChart from './components/BarChart'
  // import TransactionTable from './components/TransactionTable'
  // import TodoList from './components/TodoList'
  // import BoxCard from './components/BoxCard'

  const lineChartData = {
    newVisitis: {
      expectedData: [100, 120, 161, 134, 105, 160, 165],
      actualData: [120, 82, 91, 154, 162, 140, 145]
    },
    messages: {
      expectedData: [200, 192, 120, 144, 160, 130, 140],
      actualData: [180, 160, 151, 106, 145, 150, 130]
    },
    purchases: {
      expectedData: [80, 100, 121, 104, 105, 90, 100],
      actualData: [120, 90, 100, 138, 142, 130, 130]
    },
    shoppings: {
      expectedData: [130, 140, 141, 142, 145, 150, 160],
      actualData: [120, 82, 91, 154, 162, 140, 130]
    }
  }

  export default {
    name: 'DashboardAdmin',
    components: {
      GithubCorner,
      PanelGroup,
      LineChart,
      RaddarChart,
      PieChart,
      BarChart,
      plat,
      operateProcess
    },
    data() {
      return {
        lineChartData: lineChartData.newVisitis
      }
    },
    methods: {
      handleSetLineChartData(type) {
        this.lineChartData = lineChartData[type]
      },
    }
  }
</script>

<style lang="scss" scoped>
  .first-title {
    position: relative;
    padding-left: 14px;
    font-size: 16px;
    line-height: 50px;
    // height: 50px;
    border-bottom: none;

    i {
      margin-right: 8px;
    }
  }

  .first-title::before {
    content: '';
    height: 15px;
    width: 4px;
    background-color: #FF7F21;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  ._website {
    width: 100%;
    height: 300px;
    position: relative;
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;

    ._txt {
      color: #666666;
      font-size: 14px;
      font-weight: 600;
      padding-left: 20px;
      position: absolute;
      top: 30px;
      left: 0;
      z-index: 9;
    }

    ._websiteImg {
      width: 100%;
    }
  }

  .my-icon {
    height: 300px;
  }

  .dashboard-editor-container {
    padding: 32px;
    background-color: rgb(240, 242, 245);
    position: relative;

    .github-corner {
      position: absolute;
      top: 0px;
      border: 0;
      right: 0;
    }

    .chart-wrapper {
      background: #fff;
      padding: 16px 16px 0;
      margin-bottom: 32px;
    }
  }

  @media (max-width:1024px) {
    .chart-wrapper {
      padding: 8px;
    }
  }

  .title {
    font-size: 16px;
  }

  .container {
    border-radius: 4px;
    // margin: 0 20px;
    padding: 4px;
  }

  .tool-button-container {
    .el-col {
      text-align: center;

      button {
        width: 80%;
      }
    }
  }

  .plat-data-container {
    background-color: #FFFFFF;

    .data-container {
      background-color: #fff;
      padding: 4px;
      border-radius: 4px;
      font-size: 14px;

      .text-center {
        text-align: center;
      }
    }

    .first-title {
      padding-left: 5px;
      font-size: 18px;
      line-height: 50px;
      // height: 50px;
      border-bottom: none;

      i {
        margin-right: 8px;
      }
    }

    .second-title {
      margin-left: 16px;
      overflow: hidden;
      font-size: 14px;
      color: #000000;
      line-height: 32px;
      padding: 10px 0 10px 5px;

      i {
        margin-right: 6px;
      }
    }

    .data-title {
      padding: 5px;
      font-size: 14px;
      color: #78909C;
      display: block;
      margin-top: 10px;
    }

    .data-val {
      font-size: 24px;
      color: #000033;
      display: block;
      font-weight: 200;
      padding: 5px;
    }
  }

  .split-line-container {
    position: relative;

    .split-line {
      display: inline-block;
      width: 1px;
      height: 3em;
      vertical-align: middle;
      position: absolute;
      left: 0;
      background-color: #f0f2fa;
    }
  }

  .nav_bg1 {
    background: #0bb2d4;
  }

  .nav_bg2 {
    background: #ff7f21;
  }

  .nav_bg3 {
    background: #677afa;
  }

  .nav_bg4 {
    background: #11c26d;
  }

  .nav_bg5 {
    background: #f4516c;
  }

  .shuju_nav_list {
    display: block;
    overflow: hidden;
    padding: 0 30px;
    height: 108px;
    border-radius: 4px;
    width: 80%;
    margin: auto;

    .shuju_i {
      display: block;
      border-radius: 50%;
      margin-top: 20px;
      float: left;
      width: 60px;
      height: 60px;
      border: 5px solid rgba(255, 255, 255, 0.3);

      i {
        display: block;
        border-radius: 50%;
        background: #ffffff;
        height: 100%;

        img {
          display: block;
          height: 75%;
          margin: 0 auto;
          padding-top: 25%;
        }
      }
    }

    .shuju_list_xinxi {
      float: left;
      margin-left: 20px;
      color: #fff;
      line-height: 108px;

      span {
        font-size: 1.2em;
        display: block;
      }
    }
  }

  .el-divider__text {
    background: #f0f2f5;
  }
</style>
